<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="timeDiv" style="background-color: black;color: white;font-size: 40px;">
			0:0:00.000
		</div>
		<script>
			var d1 = new Date(); // 当前时间
			d1.setHours(0);
			d1.setMinutes(0);
			d1.setSeconds(0);
			d1.setMilliseconds(0);
			
			
			setInterval(function(){
				console.log("定时执行")
				var timeStr =d1.getHours()+":";
				timeStr +=d1.getMinutes()+":";
				timeStr +=d1.getSeconds()+".";
				timeStr +=d1.getMilliseconds();
				
				console.log(timeStr);
				timeDiv.innerHTML = timeStr;
			},10);
		</script>
	</body>
</html>
